'use strict';

angular.module('com.dcos.app').controller('LayoutMenuController', function LayoutMenuController($scope, $state, $rootScope, $cookies, LoginService, dialog) {
  var vm = this;
  vm.token = $cookies.getObject('token');

  vm.highLightMenu = function(){
  	vm.isDashBoardActive = $state.includes('app.dashboard'); // 仪表盘
    vm.isWorkFlowActive = $state.includes('app.workflow'); // 仪表盘
    vm.isTemplateManageActive = $state.includes('app.templatemanage'); // 模板
    vm.isEnvironmentActive = $state.includes('app.environ'); // 环境管理
    vm.isConfigActive = $state.includes('app.config'); // 配置管理
    vm.isProjectRightActive = $state.includes('app.projectright'); // 项目权限
    vm.isUserCenterActive = $state.includes('app.usercentter'); // 用户中心
  }

  vm.highLightMenu();
  $scope.$on('$stateChangeSuccess', function() {
  	vm.highLightMenu();
  });

  vm.changeMenu = function (url) {
    $state.go(url, {}, { reload: true });
  }

});
